﻿using System;
using System.Collections.Generic;
using Sw.Hospital.HealthExaminationSystem.Common.Enums;
using Sw.Hospital.HealthExaminationSystem.Common.Models;

namespace Sw.Hospital.HealthExaminationSystem.Common.Helpers
{
    public class VisitgradeHelper
    {
        private static readonly List<VisitgradeModel> PrintSateModels = new List<VisitgradeModel>();

        static VisitgradeHelper()
        {
            PrintSateModels.Add(new VisitgradeModel
            {
                Id = (int)Visitgrade.OneStar,
                Name = Visitgrade.OneStar.ToString(),
                Display = "⭐"
            });
            PrintSateModels.Add(new VisitgradeModel
            {
                Id = (int)Visitgrade.TwoStar,
                Name = Visitgrade.TwoStar.ToString(),
                Display = "⭐⭐"
            });
            PrintSateModels.Add(new VisitgradeModel
            {
                Id = (int)Visitgrade.threeStar,
                Name = Visitgrade.threeStar.ToString(),
                Display = "⭐⭐⭐"
            });
            PrintSateModels.Add(new VisitgradeModel
            {
                Id = (int)Visitgrade.FourStar,
                Name = Visitgrade.FourStar.ToString(),
                Display = "⭐⭐⭐⭐"
            });
            PrintSateModels.Add(new VisitgradeModel
            {
                Id = (int)Visitgrade.fiveStar,
                Name = Visitgrade.fiveStar.ToString(),
                Display = "⭐⭐⭐⭐⭐"
            });
            PrintSateModels.Add(new VisitgradeModel
            {
                Id = 3,
                Name = "AllStar",
                Display = "全部"
            });
        }
        /// <summary>
        /// 危急值状态格式化
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static string VisitgradeFormatter(object obj)
        {
            if (obj == null)
            {
                return "未知";
            }
            if (Enum.IsDefined(typeof(Visitgrade), obj))
            {
                return EnumHelper.GetEnumDesc((Visitgrade)obj);
            }
            return obj.ToString();
        }
        public static List<VisitgradeModel> GetModels()
        {
            return PrintSateModels;
        }
    }
}